/* Digital Thermometer
Everything is printed out to the serial monitor as I don't have any sort of
display screen yet.
The part used is an LM35
The white servo wire is VCC
The red servo wire is the output of the sensor
The black servo wire is GND
*/

void setup(){
  Serial.begin(9600);  // Serial output connection
}

float voltage = 0.0;
float sensor = 0.0;
float celsius = 0.0;
float fahrenheit = 0.0;

void loop(){
  sensor = analogRead(5);
  voltage = (sensor*5000)/1024;
  celsius = voltage/10;
  fahrenheit = ((celsius*1.8)+32);
  Serial.print("Temperature: ");
  Serial.print(celsius,2);
  Serial.println(" degrees C");
  Serial.print("Temperature: ");
  Serial.print(fahrenheit,2);
  Serial.println(" degrees F");
  Serial.println("_ _ _ _ _ _ _ _ _ _ _ _ _ _  ");
  delay (1000); 
}
